#!/usr/bin/env python3
# -*- coding:utf-8 -*-
###
# File: response.py
# Project: src
# File Created: Sunday, 3rd April 2022 9:50:06 pm
# Author: wuchunle (wuchunle@gsaxns.com)
# -----
# Last Modified: Tuesday, 17th May 2022 4:09:59 pm
# Modified By: wuchunle (wuchunle@gsaxns.com)
# -----
# Copyright (c) 2022 甘肃安信信息安全技术有限公司
###

from flask import make_response


class Response:
    @classmethod
    def error(self, msg):
        data = {"code": 40000, "errMsg": msg}
        response = make_response(data)
        response.status_code = 400
        return response

    @classmethod
    def success(self, data):
        data = {"code": 20000, "msg": "success", "data": data}
        response = make_response(data)
        return response
